<?
session_start();
ob_start();
if (!isset($_SESSION["sess_Username"])) { 
?>
  <script>
	alert('กรุณาทำการ Login เข้าระบบก่อน');
	</script>
	<meta http-equiv='refresh' content='0;URL=admin_login.php'>
<? } ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<script src="Scripts/AC_RunActiveContent.js" type="text/javascript"></script>
	<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>ยินดีต้อนรับเข้าสู่ ระบบบริการสื่อมัลติมีเดียด้านการเกษตร</title>
<link rel="stylesheet" href="standard.css" type="text/css" />
<script>  
	function chklogin(){
		if(document.frmLogin.user.value==''){
			alert('กรุณาใส่ Username');
			$code = '3';
			document.frmLogin.user.focus();
		} else if(document.frmLogin.passwd.value==''){
			alert('กรุณาใส่ Password');
			$code = '3';
			document.frmLogin.passwd.focus();
		} else {
			document.frmLogin.submit();
		}
}
</script>
<script type="text/javascript">
<!--
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>

</head>

<body onLoad="MM_preloadImages('img/m_main2.jpg','img/m_register2.jpg','img/m_multimedia2.jpg','img/m_manual2.jpg','img/m_evaluate2.jpg','img/m_admin2.jpg','img/m_static2.jpg','img/m_topten2.jpg')">
<div id="apDiv6"></div>
<table width="1024" height="659" border="0" align="center" cellpadding="0" cellspacing="0" bordercolor="#666600">
  <tr>
    <td height="215" align="center" valign="top" bgcolor="#CCCCCC"><table width="1024" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td height="170" background="img/headNew2.jpg" bgcolor="#FFFFFF">&nbsp;</td>
      </tr>
    </table>
      <table width="824" border="0" cellpadding="0" cellspacing="0" bordercolor="#FF0000">
        <tr>
          <td width="103" height="45" align="center"><a href="index.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image12','','img/m_main2.jpg',1)"><img src="img/m_main.jpg" name="Image12" width="115" height="45" border="0" id="Image12" /></a></td>
          <td width="103" align="right"><a href="user_register.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image13','','img/m_register2.jpg',1)"><img src="img/m_register.jpg" name="Image13" width="115" height="45" border="0" id="Image13" /></a></td>
          <td width="103" align="right"><a href="vdo_list.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image14','','img/m_multimedia2.jpg',1)"><img 
src="img/m_multimedia.jpg" name="Image14" width="117" height="45" border="0" id="Image14" /></a></td>
          <td width="103"><a href="vdo_top10.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image11','','img/m_topten2.jpg',1)"><img 
src="img/m_topten.jpg" name="Image11" width="115" height="45" border="0" id="Image11" /></a></td>
          <td width="103"><a href="admin_report_search.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image10','','img/m_static2.jpg',1)"><img 
src="img/m_static.jpg" name="Image10" width="215" height="45" border="0" id="Image10" /></a></td>
          <td width="103"><a href="manual.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image9','','img/m_manual2.jpg',1)"><img src="img/m_manual.jpg" name="Image9" width="117" height="45" border="0" id="Image9" /></a></td>
          <td width="103"><a href="evaluate_overview.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image8','','img/m_evaluate2.jpg',1)"><img src="img/m_evaluate.jpg" name="Image8" width="115" height="45" border="0" id="Image8" /></a></td>
          <td width="103"><a href="admin_login.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image15','','img/m_admin2.jpg',1)"><img src="img/m_admin.jpg" name="Image15" width="115" height="45" border="0" id="Image15" /></a></td>
        </tr>
      </table></td>
  </tr>
  <tr>
    <td width="1024" height="66" align="center" valign="top" bgcolor="#FFFFFF"><table width="1024" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="25" height="25" background="img/tb/tb_left_top.jpg">&nbsp;</td>
        <td height="25" background="img/tb/tb_top.jpg">&nbsp;</td>
        <td width="25" height="25" background="img/tb/tb_right_top.jpg">&nbsp;</td>
      </tr>
      <tr>
        <td width="25" align="left" background="img/tb/tb_left.jpg">&nbsp;</td>
        <td align="center"><table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td height="30" align="left" bgcolor="#CCFF00" class="style7"><span class="scapmain style4 style12 style25 style9">&nbsp;<img src="img/img05.gif" align="absbottom" /></span><span class="style9"> ส่วนจัดการข้อมูลหลัก</span></td>
            </tr>
            <tr>
              <td align="center" valign="top" bgcolor="#FFFFFF">
              
              <table width="95%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="" align="left">
<?php echo "ยินดีต้อนรับเข้าสู่ระบบค่ะคุณ <b>$sess_Name $sess_LName</b>"; ?><br/>
<?php echo "คุณสามารถดูข้อมูลส่วนตัวได้ <b><a href='admin_details.php' class='style26'>[ที่นี่]</a></b>"; ?>
</td>

<td align="right">
  <table width="30%" border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td width="43%" rowspan="2" align="center">&nbsp;</td>
      <td width="57%" align="center">
<? if(isset($_SESSION["sess_Username"])){echo"<a href="."admin_logout.php"."><img src="."pic/logout(red)_icon.jpeg"." width='30' alt='ออกจากระบบ' border='0'/></a>";} ?>
				 	</td>
    </tr>
    <tr>
      <td align="center" nowrap="nowrap"><a href="admin_logout.php" class="style20">ออกจากระบบ</a></td>
    </tr>
  </table>
    <a href="admin_logout.php" class="style20"></a></td>
</tr>
<br>
</table>
              
            
                <table width="50%" border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td height="30">&nbsp;</td>
                  </tr>
                </table>
                <table width="98%" border="0" cellpadding="0" cellspacing="2">
                  <tr class="style21">
                    <td align="center"><p class="style16"><img src="pic/user.png" width="128" height="128" align="absmiddle" /></p>
                        <p class="style16"><span class="style7">ผู้ดูแลระบบ</span></p>
                      <p class="style16">
   <input type="button" name="admin" id="admin" value="แสดง"  onclick="javaScript:if(this.click){document.all.tbadmin.style.display='';
                          <? $_SESSION['tbadmin'] = '1'; ?>
                          }"/>
   <input type="button" name="admin" id="admin" value="ซ่อน"  onclick="javaScript:if(this.click){document.all.tbadmin.style.display='none';
                          <? $_SESSION['tbadmin'] = '0'; ?>
                          }"/>
                      </p></td>
                    <td align="center"><p class="style16"><img src="pic/movies.png" width="128" height="128" align="absmiddle" /></p>
                        <p class="style16"><span class="style7">สื่อมัลติมีเดีย</span></p>
                      <p class="style26 style24">
                          <input type="button" name="multimedia" id="multimedia" value="แสดง" onClick="javaScript:if(this.click){document.all.tbmultimedia.style.display='';
                          <? $_SESSION['tbmultimedia'] = '1'; ?>
                          }"/>
                          <input type="button" name="multimedia2" id="multimedia" value="ซ่อน" onClick="javaScript:if(this.click){document.all.tbmultimedia.style.display='none';
                          <? $_SESSION['tbmultimedia'] = '0'; ?>
                          }"/>
                      </p></td>
                    <td align="center"><p class="style16"><img src="pic/report.png" width="128" height="128" align="absmiddle" /></p>
                        <p class="style16"><span class="style7">รายงาน</span></p>
                      <p class="style16">
                          <input type="button" name="report" id="report" value="แสดง"  onclick="javaScript:if(this.click){document.all.tbreport.style.display='';
                          <? $_SESSION['tbreport'] = '1'; ?>
                          }"/>
                          <input type="button" name="report" id="report" value="ซ่อน"  onclick="javaScript:if(this.click){document.all.tbreport.style.display='none';
                          <? $_SESSION['tbreport'] = '0'; ?>
                          }"/>
                      </p></td>
                    <td align="center"><p class="style16"><img src="pic/evaluate.png" width="128" height="128" align="absmiddle" /></p>
                        <p class="style16"><span class="style7">อื่นๆ</span></p>
                      <p class="style16">
                          <input type="button" name="evaluate" id="evaluate" value="แสดง"  onclick="javaScript:if(this.click){document.all.tbevaluate.style.display='';
                          <? $_SESSION['tbevaluate'] = '1'; ?>
                          }"/>
                          <input type="button" name="evaluate" id="evaluate" value="ซ่อน"  onclick="javaScript:if(this.click){document.all.tbevaluate.style.display='none';
                          <? $_SESSION['tbevaluate'] = '0'; ?>
                          }"/>
                      </p></td>
                    </tr>
                  <tr>
                    <td align="center">&nbsp;</td>
                    <td align="center">&nbsp;</td>
                    <td align="center">&nbsp;</td>
                    <td align="center">&nbsp;</td>
                    </tr>
                  <tr>
                    <td align="center" valign="top"><table width="90%" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFBF" id="tbadmin">
                        <tr>
                          <td height="50" align="center" class="style20"><a href="admin_list.php" class="style20">รายการผู้ดูแลระบบ</a></td>
                        </tr>
                        
                    </table></td>
                    <td align="center" valign="top"><table width="90%" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFBF" id="tbmultimedia">
                        <tr>
                          <td height="50" align="center" class="style20"><a href="vdo_list_edit.php" class="style20">รายการสื่อมัลติมีเดีย</a></td>
                        </tr>
                        <tr>
                          <td height="50" align="center" class="style20"><a href="admin_vdotype.php" class="style20">ประเภทเนื้อหาสื่อมัลติมีเดีย</a></td>
                        </tr>
                    </table></td>
                    <td align="center" valign="top"><table width="90%" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFBF" id="tbreport">
                        <tr>
                          <td height="50" align="center" class="style20"><a href="admin_report_user.php" class="style20">ผู้ใช้บริการ</a></td>
                        </tr>
                        <tr>
                          <td height="50" align="center" class="style20"><a href="admin_report_view.php" class="style20">การเข้าใช้บริการสูงสุด</a><a href="admin_usertype.php" class="style20"></a></td>
                        </tr>
                        <tr>
                          <td height="50" align="center" class="style20"><a href="admin_report_view.php" class="style35"></a><a href="admin_report_search.php" class="style20">สถิติการสืบค้นข้อมูล</a></td>
                        </tr>
                        <tr>
                          <td height="50" align="center" class="style20" ><a href="admin_report_evaluate_overview.php" class="style20">ความพึงพอใจของผู้ใช้งาน</a></td>
                        </tr>
                    </table></td>
                    <td align="center" valign="top"><table width="90%" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFBF" id="tbevaluate">
                        <tr>
                          <td height="50" align="center" class="style20"><a href="admin_evaluate.php" class="style20">แบบประเมิน</a></td>
                        </tr>
                        <tr>
                          <td height="50" align="center" class="style20"><a href="admin_usertype.php" class="style20">ประเภทผู้ใช้บริการ</a></td>
                        </tr>
                    </table></td>
                    </tr>
                </table>
                <p>
<font face="utf-8"  size="2" color="#008000">
<!-- ใส่  URL ของไฟล์ online.php?js=1 ครับ -->
<script src="useron/online.php?js=1"></script>
</font> </p>
                </td>
            </tr>
            <tr>
              <td height="25" bgcolor="#CCFF00">&nbsp;</td>
            </tr>
        </table></td>
        <td width="25" align="right" background="img/tb/tb_right.jpg">&nbsp;</td>
      </tr>
      <tr>
        <td width="25" height="25" background="img/tb/tb_left_foot.jpg">&nbsp;</td>
        <td height="25" background="img/tb/tb_foot.jpg">&nbsp;</td>
        <td width="25" height="25" background="img/tb/tb_right_foot.jpg">&nbsp;</td>
      </tr>
    </table></td>
  </tr>
  
  <tr>
    <td width="1024" align="center" valign="bottom"><table width="50%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td height="25">&nbsp;</td>
      </tr>
    </table>
      <table width="1024" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td height="50"><table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td width="25" height="25" background="img/tb/tb_left_top.jpg">&nbsp;</td>
              <td background="img/tb/tb_top.jpg">&nbsp;</td>
              <td width="25" height="25" background="img/tb/tb_right_top.jpg">&nbsp;</td>
            </tr>
            <tr>
              <td width="25" align="left" background="img/tb/tb_left.jpg">&nbsp;</td>
              <td height="25" align="center" valign="middle" bgcolor="#CCFF00"><table width="96%" border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td height="25" align="center"><strong>ศูนย์ความรู้ด้านการเกษตร สำนักหอสมุด มหาวิทยาลัยเกษตรศาสตร์</strong></td>
                  </tr>
              </table></td>
              <td width="25" align="right" background="img/tb/tb_right.jpg">&nbsp;</td>
            </tr>
            <tr>
              <td width="25" height="25" background="img/tb/tb_left_foot.jpg">&nbsp;</td>
              <td background="img/tb/tb_foot.jpg">&nbsp;</td>
              <td width="25" height="25" background="img/tb/tb_right_foot.jpg">&nbsp;</td>
            </tr>
        </table></td>
      </tr>
    </table></td>
  </tr>
</table>
<p>&nbsp;</p>
</body>
</html>
<script>
//document.all.tbmultimedia.style.display='none';
//document.all.tbreport.style.display='none';
//document.all.tbevaluate.style.display='none';
//document.all.tbadmin.style.display='none';
</script>
<?php /*?><?php 
if($_SESSION['tbmultimedia'] == '0')	{ ?> <script>document.all.tbmultimedia.style.display='none';</script> <? }
if($_SESSION['tbreport'] == '0')		{ ?> <script>document.all.tbreport.style.display='none';</script> <? }
if($_SESSION['tbevaluate'] == '0')		{ ?> <script>document.all.tbevaluate.style.display='none';</script> <? }
if($_SESSION['tbadmin'] == '0')			{ ?> <script>document.all.tbadmin.style.display='none';</script> <? }
echo "<br>tbmultimedia = ".$_SESSION['tbmultimedia'];
echo "<br>tbreport     = ".$_SESSION['tbreport'];
echo "<br>tbevaluate   = ".$_SESSION['tbevaluate'];
echo "<br>tbadmin      = ".$_SESSION['tbadmin'];
?><?php */?>